import request from '@/utils/request'

export function fetchList() {
    return request({
        url: '/api/img',
        method: 'get',
    })
}
//获取分类列表
export function getCateList(query) {
    return request({
        url: '/category/list',
        method: 'get',
        params: query
    })
}
//修改分类状态
export function switchCateStatus(id, data) {
    return request({
        url: `/category/cancel/${id}`,
        method: 'put',
        data,
    })
}
//获取分类详情
export function getCateDetail(id) {
    return request({
        url: `/category/${id}`,
        method: 'get',
    })
}
//编辑分类详情
export function editCate(id, data) {
    return request({
        url: `/category/${id}`,
        method: 'put',
        data,
    })
}
//添加分类
export function addCate(data) {
    return request({
        url: '/category/detail',
        method: 'post',
        data,
    })
}
//删除分类
export function delCate(id) {
    return request({
        url: `/category/${id}`,
        method: 'delete'
    })
}